//数字颠倒
#include <stdio.h>
//法一：
int main()
{
    int a = 0;
    while (scanf("%d", &a) != EOF)
    {
        if (a == 0)
        {
            printf("0");
            return 0;
        }
        while (a != 0)
        {
            printf("%d", a % 10);
            a /= 10;
        }
    }
    return 0;
}
//法二：
#include <string.h>
int main()
{
    char str[1000] = { 0 };
    while (scanf("%s", str) != EOF)
    {
        int len = strlen(str);
        int i = 0;
        for (i = len - 1; i >= 0; i--)
        {
            printf("%c", str[i]);
        }
    }
    return 0;
}